import {action, observable} from 'mobx';
import {useLocalObservable} from 'mobx-react';

export type IUser = {
  name: string;
  age: number;
  showAge: boolean;
  setAge: (age: number) => void;
};
export const user = observable<IUser>(
  {
    name: 'John',
    age: 42,
    showAge: false,
    setAge(age: number) {
      this.age = age;
    },
  },
  {
    setAge: action,
  },
);
